package middleware

import (
	"log"
	"time"

	"gitee.com/pangxianfei/frame/request"
)

func exampleMiddle() request.HandlerFunc {
	return func(c request.Context) {
		t := time.Now()
		// 设置 example 变量
		c.Set("example", "12345")
		// 请求前
		c.Next()
		// 请求后
		latency := time.Since(t)
		log.Print(latency)
	}
}
